Class Node

  • All Implemented Interfaces:
    java.lang.Comparable<Node>

    public class Node
    extends java.lang.Object
    implements java.lang.Comparable<Node>
    Represents a node in memory. A simple implementation requiring only an identifier.
    Version:
    1.1.1 June 16, 2015
    Author:
    Charles Allen Schultz II
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String identifier
      The string representing the node's unique name.
    • Constructor Summary

      Constructors 
      Constructor Description
      Node​(java.lang.String identifier)
      Initializes the Node object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(Node that)  
      Node duplicate()
      Returns a copy of this Node that is a new object in memory.
      boolean equals​(java.lang.Object o)  
      java.lang.String getIdentifier()
      Access method for the Node's identifier.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • identifier

        private final java.lang.String identifier
        The string representing the node's unique name.
    • Constructor Detail

      • Node

        public Node​(java.lang.String identifier)
        Initializes the Node object.
        Parameters:
        identifier - the String representing the Node's identifier.
    • Method Detail

      • getIdentifier

        public java.lang.String getIdentifier()
        Access method for the Node's identifier.
        Returns:
        the String identifying the Node.
      • duplicate

        public Node duplicate()
        Returns a copy of this Node that is a new object in memory.
        Returns:
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(Node that)
        Specified by:
        compareTo in interface java.lang.Comparable<Node>